From b5267220005bf82949951777533df6257cfacaa8 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 Jun 2020 12:23:32 -0400 Subject: [PATCH] button: Center images If we leave the valign to be the default fill, then the images pick up baseline alignment from the environment, which can occasionally lead to misplaced -/+ icons in spinbuttons, for example in the "Page Setup" tab of the print dialog. --- gtk/gtkbutton.c | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk/gtkbutton.c b/gtk/gtkbutton.c index dc96c752b1..425bac0675 100644 --- a/gtk/gtkbutton.c +++ b/gtk/gtkbutton.c @@ -973,6 +973,7 @@ gtk_button_set_icon_name (GtkButton *button, { GtkWidget *child = gtk_image_new_from_icon_name (icon_name); gtk_button_set_child (GTK_BUTTON (button), child); + gtk_widget_set_valign (child, GTK_ALIGN_CENTER); gtk_widget_remove_css_class (GTK_WIDGET (button), "text-button"); gtk_widget_add_css_class (GTK_WIDGET (button), "image-button"); } -- 2.30.2